

drop_item_gailv = {
    [1] = { [101] = 1},
    [2] = { [101] = 1},
    [3] = { [101] = 1},
    [4] = { [80] = 1},
    [5] = { [70] = 1, [95] = 2},
    [6] = { [60] = 1, [90] = 2},
    [7] = { [40] = 1, [70] = 2, [95] = 3},
    [8] = { [20] = 1, [50] = 2, [90] = 3},
    [9] = { [0] = 1, [30] = 2, [70] = 3},
}
function func()
    local a = {1,2,3,4,5}
    print(a[8])
end
function dropItem(unit_level)
    
    -- local ran = math.random(1,100)
    local ran = 96
    local item_count = 0
    local curr_per = 0

    if drop_item_gailv[unit_level] ~= nil then
        for per,lv in pairs(drop_item_gailv[unit_level]) do
            if ran >= per and curr_per<=per then
                curr_per = per
                item_count = lv
            end
        end
    end
    print(item_count)

end

dropItem(5)